/* 
 * Copyright [2018] [Alex/libo(liboms@hotmail.com)]
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.hyts.parser.config;

/** 
 * @title ParseContentUnit.java  
 * @package com.hyts.parser.config  
 * @description 解析信息数据-内容的单位  
 * @see TODO
 * @author libo/Alex
 * @email liboms@hotmail.com/liboware@163.com  
 * @date 2018年4月9日 
 * @version V1.0 
 */
public enum ParseContentUnit {
	
	B(1){
		public int get(int num){
			return this.getUnitSolution()*num;
		}
	},
	KB(1024){
		public int get(int num){
			return this.getUnitSolution()*num;
		}
	},
	MB(1024<<10){ 
		public int get(int num){
			return this.getUnitSolution()*num;
		}
	},
	GB(1024<<10<<10){
		public int get(int num){
			return this.getUnitSolution()*num;
		}
	};
	
	public int UnitSolution;
	public abstract int get(int num);
	/**  
	 * @constructor：ParseContentUnit  
	 * @param unitSolution  
	 */ 
	private ParseContentUnit(int unitSolution) {
		UnitSolution = unitSolution;
	}

	/**  
	 * @name unitSolution's getter method
	 * @param none
	 * @return unitSolution
	 */
	public int getUnitSolution() {
		return UnitSolution;
	}

	/**  
	 * @name unitSolution's setter method
	 * @param unitSolution
	 * @return void
	 */
	public void setUnitSolution(int unitSolution) {
		UnitSolution = unitSolution;
	}
	
	public static void main(String[] args) {
		System.out.println(ParseContentUnit.MB.get(2));
		
	}
	
}
